import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'package:get/get.dart';
import 'app/routes/app_pages.dart';

void main() {
  // 透明状态栏配置
  SystemUiOverlayStyle systemUiOverlayStyle =
      const SystemUiOverlayStyle(statusBarColor: Color.fromRGBO(0, 0, 0, 0));
  SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);

  runApp(
    ScreenUtilInit(
      designSize: const Size(1080, 2400), // 配置 设计稿的宽度和高度， 单位随意，但是必须与后续单位一致。
      splitScreenMode: true, // 支持分屏尺寸
      minTextAdapt: true, // 是否根据宽度/高度中的最小值适配文字
      child: GetMaterialApp(
        debugShowCheckedModeBanner: false,
        title: "Shop",
        theme: ThemeData(
          primaryColor: Colors.red,
          scaffoldBackgroundColor: Colors.white,
          splashColor: Colors.transparent, // 取消按钮水波纹
          highlightColor: Colors.transparent, // 取消按钮水波纹
          splashFactory: NoSplash.splashFactory,
        ),
        initialRoute: AppPages.INITIAL,
        getPages: AppPages.routes,
        builder: EasyLoading.init(),
      ),
    ),
  );
}
